import request from '@/utils/request';

//discover列表
export const getMcpserverList = (data) => {
  return request({
    url: `/mcp_server/list`,
    method: 'get',
    params:data,
  });
};
// install 列表
export const getAppliedList = (data) => {
    return request({
      url: `/mcp_server/applied_list`,
      method: 'get',
      params:data,
    });
};

// 应用插件
export const installPlugin = (data) => {
  return request({
    url: `/mcp_server/apply`,
    method: 'post',
    data:data,
  });
}
// 添加自定义插件
export const addCustomPlugin = (data) => {
  return request({
    url: `/mcp_server`,
    method: 'post',
    data:data,
  });
}

// plugins type
export const getPluginsType = (data) => {
  return request({
    url: `/tag`,
    method: 'get',
    params:data,
  });
}

// 是否自动授权
export const executeAuthorization = (data) => {
  return request({
    url: `/mcp_server/execute_authorization`,
    method: 'put',
    params:data,
  });
}

// 取消已经install插件
export const delInstallPlugin = (data) => {
  return request({
    url: `/mcp_server/cancel`,
    method: 'delete',
    params:data,
  });
}
// 删除插件
export const delPlugin = (data) => {
  return request({
    url: `/mcp_server`,
    method: 'delete',
    params:data,
  });
}
// 是否启用插件
export const enabledPlugin = (data) => {
  return request({
    url: `/mcp_server/enabled`,
    method: 'put',
    params:data,
  });
}


